/****************************************************************
 * I am the AC 130 vs Pirate game. I allow the user to control an 
 * AC130 gunship in the hunt for Modern day pirates. The player  
 * will be allowed to roam free across a section of ocean/coastline.  
 * In the water there will be four types of vessels: Merchant  
 * ships that the player must protect, Pirate ships that the player  
 * must identify and destroy, Fishing boats that look like Pirate  
 * ships that the player must not destroy, and Friendly Navy ships  
 * that can capture pirates for extra points. Time permitting there  
 * may also be ground targets to attack. 
 *
 * Key elements of this project will be the Player/AC130, the Ships,  
 * the ShipAI system, the collision grid, the debris controller, the  
 * Ground/Water, Clouds, and scoring system. This project will make  
 * use of an external text file to store useful game parameters,  
 * thus allowing us to play balance the game without recompiling  
 * the executable. 
 *****************************************************************
 * I am the Bullet cotroll class. I contain all the information
 * needed to render the bullets in the game. I read and store all
 * the type data and images. I have functions that 
 *****************************************************************/

#include "Camera.h"
#include "GameData.h"
#include "Bullet.h"
#include "GameData.h"
#include "CrashBin.h"
#include <allegro.h>

#ifndef __BULLET_CTRL_H__
#define __BULLET_CTRL_H__

#define BULLETMAX 1024
#define BULLETTYPE 10
#define BULLETANIM 6

class BulletCtrl {
public:
	BITMAP * tempBmp;
	GameData * gd;
	CrashBin * myCrashBin;
		// instance data
	Point * helper;
	Bullet * myBullet[BULLETMAX];
	int lastSpawn;
		// reference to bullets exploding this round

		// type data
	BITMAP * tracer[BULLETTYPE];
	int maxAge[BULLETTYPE];
	float speed[BULLETTYPE];
	float dammage[BULLETTYPE];
	float killRad[BULLETTYPE];
	bool isTrack[BULLETTYPE];
	float turnRate[BULLETTYPE];
	BITMAP * blastMask[BULLETTYPE];
	int maxAnim[BULLETTYPE];
	BITMAP * animBlast[BULLETTYPE][BULLETANIM];
	BITMAP * animSplash[BULLETTYPE][BULLETANIM];

public:
	BulletCtrl();
	~BulletCtrl();

	void Init(GameData * exGd, CrashBin* exCrashBin);
	void LoadType(char * pre, int type);

	Bullet * Spawn(Point * start, Point * target, int type, int loyalty);

	void RegisterBin();
	void Update();
	void Draw(Camera * cam);

};


#endif